#include <stdio.h>

char decimalToHex(int decimalNum) {
	char hexChar;
	if (decimalNum >= 0 && decimalNum <= 9) {
		hexChar = '0' + decimalNum;  // 如果是0-9的数字，直接转换为对应的字符
	} else if (decimalNum >= 10 && decimalNum <= 15) {
		hexChar = 'A' + (decimalNum - 10);  // 如果是10-15的数字，转换为A-F的字符
	} else {
		hexChar = '0';  // 其他情况返回0
	}
	return hexChar;
}

int main() {
	int decimalNumber = 100;
	char hexValue = decimalToHex(decimalNumber);
	printf("Hexadecimal value: %x\n", hexValue);
	return 0;
}
